<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			var date1 = new Date();
			console.log(date1);// Wed Aug 12 2020 15:17:39 GMT+0800 (中国标准时间)
			
			var date2 = new Date('2020/08/11 11:12:20');
			console.log(date2);// Tue Aug 11 2020 11:12:20 GMT+0800 (中国标准时间)
			
			var year = date2.getFullYear();
			console.log('year: ' + year);// 2020
			var month = date2.getMonth();
			console.log('month: ' + month)// 7
			var day = date2.getDate();
			console.log('day: ' + day)// 11
			// 2020年8月11日
			console.log(year + '年' + (month + 1) + '月' + day + '日');
		
			console.log(date1.toLocaleDateString());// 2020/8/12
			console.log(date1.toLocaleTimeString());// 下午3:26:03
		</script>
	</body>
</html>
